package org.ioc.com.mybatis_demo3.controller;

import org.ioc.com.mybatis_demo3.model.UserInfo;
import org.ioc.com.mybatis_demo3.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/res")
@RestController
public class UserInfoController {
    @Autowired
    UserInfoService userInfoService;
    @RequestMapping("/get")
    public List<UserInfo> get(){
        return userInfoService.select();
    }

    @RequestMapping("/delete")
    public void delete(Integer id){
        userInfoService.delete(id);
    }
}
